<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<title>InitMenuItems</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>InitMenuItems</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">Addons</a>
</div>


<div class=shortdescr>
The <dfn>InitMenuItems</dfn> function translates
an array of <a href="structures/initmenuitem.html">InitMenuItem</a> structures to
an array of <a href="../structures/farmenuitem.html">FarMenuItem</a> structures.

<p class=note><img src="../../images/caution.gif" alt="Attention!" width="10" height="10"> Attention!</p>
<UL class=note><LI>The <dfn>InitMenuItems</dfn> function is not part of the standard API.</LI></UL>
</div>

<pre class=syntax>
void InitMenuItems(
         const struct InitMenuItem *Init,
         struct FarMenuItem *Item,
         int ItemsNumber)
{
  int I;
  struct FarMenuItem *PItem=Item;
  const struct InitMenuItem *PInit=Init;
  for (I=0; I &lt; ItemsNumber; I++,PItem++,PInit++)
  {
    PItem-&gt;Selected=PInit-&gt;Selected;
    PItem-&gt;Checked=PInit-&gt;Checked;
    PItem-&gt;Separator=PInit-&gt;Separator;
    if ((unsigned int)PInit-&gt;Text &lt; 2000)
      strcpy(PItem-&gt;Text,GetMsg((unsigned int)PInit-&gt;Text));
    else
      strcpy(PItem-&gt;Text,PInit-&gt;Text);
  }
}
</pre>
<h3>Parameters</h3>
<div class=descr>

    <div class=dfn>Init</div>
    <div class=dfndescr>Pointer to an array of <a href="structures/initmenuitem.html">InitMenuItem</a> structures.
      Each array item defines one menu item.</div>
    <div class=dfn>Item</div>
    <div class=dfndescr>Pointer to an array of <a href="../structures/farmenuitem.html">FarMenuItem</a>
      structures to initialize. Each array item defines one menu item.</div>
    <div class=dfn>ItemsNumber</div>
    <div class=dfndescr>Number of elements in <i>Init</i>.</div>

</div>

<h3>Return value</h3>
<div class=descr>
  <p>None.</p>
</div>

<h3>Remarks</h3>
<div class=descr>
  <p>Use of the <dfn>InitMenuItems</dfn> function is reasoned by the following:<br>
  <i>FarMenuItem.Text</i> variable is large, that's why direct
  initalization of an array of <dfn>FarMenuItem</dfn> structures may significantly increase
  memory usage.</p>

  <p>Example bellow shows how to use the InitMenuItems function and the
  <a href="structures/initmenuitem.html">InitMenuItem</a> structure to
  create a menu.</p>
</div>


<!-- h3>Example</h3>
<div class=descr>
  Menu sample...
<pre class=code>...
</pre>
</div -->

<div class=see>See also:</div><div class=seecont>
<a href="../service_functions/menu.html">Menu</a> |
<a href="structures/initmenuitem.html">InitMenuItem</a> |
<a href="../structures/farmenuitem.html">FarMenuItem</a>
</div>

</body>
</html>